ActiveReports 12 Server User Guide
REST API HTML5 Sample
ActiveReports 12 Server User Guide > Samples and Walkthroughs > Samples > REST API HTML5 Sample

The ActiveReports Server installation includes a REST API sample for HTML5 Viewer that you can find in:

C:\ActiveReports 12 Server\SDK\Samples\REST API HTML5 Sample

This sample is also part of the ActiveReports Server Samples sample project that you can find in:

C:\ActiveReports 12 Server\SDK\Samples

The REST API HTML5 sample demonstrates how to call the most frequently used REST API methods in your custom ActiveReports Server application. To open the solution, double-click the REST API HTML5 Sample.csproj file.

Note: To have the sample work properly, you need to update the ActiveReports Server web-site to accept cross-domain requests.
Go to C:\ActiveReports 12 Server\Site path and add the following lines in the <system.webServer> section of the web.config file:

<httpProtocol>
        <customHeaders>
                <add name="Access-Control-Allow-Origin" value="*" />
                <add name="Access-Control-Allow-Headers" value="AuthToken, Authorization, Origin, Content-Type, Accept, X-Requested-With" />
                <add name="Access-Control-Expose-Headers" value="X-ARS-DocumentId" />
        </customHeaders>
</httpProtocol>

The sample application requires Internet Explorer 9 or higher.

To run the sample:

  1. When you run the sample, following login screen appears:



  2. Enter the login information. Following RestfulAPI sample window appears:
    Image Title

    Image Title



  3. Click a report from the list of reports to preview it in the right pane.

When a report is open for preview, you can choose one of the following operations to perform on the report.

Save file in this format

You can choose from the following available formats to save your report. When you click the Run button, the report is saved in the selected format.

Print using a printer on Server

When you click the Run button with this option selected, the following window appears. Select the Server printing options and click Print

Print using a printer on Client 

When you click the Run button with this option selected, the report opens. Select the client printing options and click Print

For the ActiveReports Server REST API documentation, please see http://arhelp.grapecity.com/webhelp/AR12Server/WebAPI/index.html.

See Also